package cn.com.surker.material.dao;

import cn.com.surker.material.entity.MaterialOutbound;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 材料领用记录 Mapper 接口
 * </p>
 *
 * @author admin
 * @since 2023-07-19
 */
public interface MaterialOutboundDao extends BaseMapper<MaterialOutbound> {


	/**
	 * 查询出库模型数据
	 * @return
	 */
	Page<MaterialOutbound> selectOutPage(Page page, @Param(Constants.WRAPPER) Wrapper<MaterialOutbound> queryWrapper);

	@Override
	List<MaterialOutbound> selectList(@Param(Constants.WRAPPER) Wrapper<MaterialOutbound> queryWrapper);

	/**
	 * 查询物品领取分页
	 * @param orgId
	 * @param searchVal
	 * @param startTime
	 * @param endTime
	 * @param offset
	 * @param limit
	 * @return
	 */
	List<Map<String, Object>> findOutPage(Long orgId, String searchVal, String startTime,
                                          String endTime, Integer offset, Integer limit);

	/**
	 * 查询物品分页总数
	 * @param orgId
	 * @param searchVal
	 * @param startTime
	 * @param endTime
	 * @return
	 */
	Integer findOutTotal(Long orgId, String searchVal, String startTime, String endTime);

	/**
	 * 查询领取详情
	 * @param outId
	 * @return
	 */
	List<Map<String, Object>> findOutDetail(Long outId);
}
